-
-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/merge server client webpack #398
Conversation
63074b5
to
8401c9d
Compare
Some comments. Reviewed 39 of 39 files at r1. lib/generators/USAGE, line 3 [r1] (raw file): lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt, line 2 [r1] (raw file): lib/generators/react_on_rails/templates/base/base/client/webpack.config.js, line 38 [r1] (raw file): lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt, line 14 [r1] (raw file): This needs to be "" if not server rendering. search code for server_bundle_js_file and you'll see lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt, line 11 [r1] (raw file): also need to always pass the lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt, line 12 [r1] (raw file): const store = ReactOnRails.getStore("myStore"); that way you can have multiple react components use the same store lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt, line 22 [r1] (raw file): Comments from Reviewable |
lib/generators/react_on_rails/templates/base/base/client/webpack.config.js, line 38 [r1] (raw file): Comments from Reviewable |
lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt, line 14 [r1] (raw file): Comments from Reviewable |
lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt, line 14 [r1] (raw file):
and
Now I think we have a few options.
I'm personally in favor of just going for a single config since most people will just be putting the entire bundle in their header which is awesome with turbolinks. And if you need to optmize, then you can still do vendor chunks as needed which would still play nice with all of this. Comments from Reviewable |
lib/generators/USAGE, line 3 [r1] (raw file): Comments from Reviewable |
0ee40ba
to
aa3d80f
Compare
Just changed the webpack compilation checks for the tests. Now it just checks to see if any stale files exist and then runs a new config variable we added if they do. we default to 'npm run build'. |
Got some questions. Also Please see https://github.com/shakacode/react_on_rails/blob/master/docs%2Fcontributor-info%2Fcontributing.md. Notably, we need a changelog entry. Review status: 40 of 48 files reviewed at latest revision, 8 unresolved discussions. Comments from Reviewable |
@jbhatab Is this almost ready? |
Reviewed 1 of 39 files at r1, 4 of 12 files at r2, 7 of 11 files at r3. lib/react_on_rails.rb, line 17 [r3] (raw file): lib/generators/react_on_rails/templates/base/base/package.json.tt, line 12 [r1] (raw file): lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt, line 14 [r1] (raw file): lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt, line 11 [r1] (raw file): lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt, line 12 [r1] (raw file): lib/react_on_rails/test_helper.rb, line 57 [r3] (raw file): lib/react_on_rails/test_helper/ensure_assets_compiled.rb, line 49 [r3] (raw file): Comments from Reviewable |
Reviewed 26 of 39 files at r1, 10 of 12 files at r2, 8 of 11 files at r3. lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt, line 2 [r1] (raw file): Comments from Reviewable |
lib/react_on_rails.rb, line 17 [r3] (raw file): Comments from Reviewable |
lib/generators/react_on_rails/templates/base/base/package.json.tt, line 12 [r1] (raw file): Comments from Reviewable |
lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt, line 2 [r1] (raw file): Comments from Reviewable |
lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt, line 14 [r1] (raw file): Comments from Reviewable |
lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt, line 12 [r1] (raw file): Comments from Reviewable |
lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt, line 22 [r1] (raw file): Comments from Reviewable |
8397068
to
7dcc845
Compare
|
||
* Redux | ||
|
||
Passing the --redux generator option causes the generated Hello World example | ||
to integrate the Redux state container framework. The necessary node modules | ||
will be automatically included for you. | ||
|
||
The generator uses the organizational `paradigm of "bundles"`. These are like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which file did this go to? or just removed, @jbhatab
Objective of these changes is to make the generator simpler, partly by simplfying the default behavior of ReactOnRails. * combined webpack files into one webpack config, fixed corresponding tests and code. cleaned up some documentation. * removed jquery, fixed some linting. removed lodash completely * changed asset compliation checks * moved files from server rendering to base for templates * changed server-bundle to webpack-bundle * added prodcution build command and test build command. changed configuration to test build command to be more explicit. changed around some readmes * changed build:dev to build:development
@@ -13,8 +13,7 @@ static vs. hot is picked based on whether `ENV["REACT_ON_RAILS_ENV"] == "HOT"` | |||
|
|||
<!-- These do not use turbolinks, so no data-turbolinks-track --> | |||
<!-- This is to load the hot assets. --> | |||
<%= env_javascript_include_tag(hot: ['http://localhost:3500/vendor-bundle.js', | |||
'http://localhost:3500/app-bundle.js']) %> | |||
<%= env_javascript_include_tag(hot: ['http://localhost:3500/webpack-bundle.js') %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbhatab no reason to change this doc file. the point was to show that it can take multiple files. It doesn't need to correspond to the generated file, and you missed the closing square bracket.
c19304e
to
540aa79
Compare
08eaadc
to
a9f1f38
Compare
@samnang, @jbhatab @robwise can you review a9f1f38 This is deployed live at http://www.reactrails.com. |
a11f7f7
to
89202e1
Compare
lib/generators/USAGE, line 3 [r10] (raw file):
|
Reviewed 2 of 3 files at r9, 10 of 15 files at r11, 6 of 10 files at r12, 4 of 4 files at r13. lib/generators/USAGE, line 3 [r10] (raw file):
|
Reviewed 1 of 7 files at r4, 5 of 8 files at r5, 5 of 16 files at r6, 2 of 5 files at r7. lib/generators/react_on_rails/templates/base/base/.DS_Store, line 0 [r13] (raw file): Comments from Reviewable |
Review status: all files reviewed at latest revision, 13 unresolved discussions. lib/generators/react_on_rails/base_generator.rb, line 97 [r6] (raw file):
|
Ready? I think so.
|
Misc fine tuning * Update travis to ruby 2.3.1 * Fixed doc in config file * Update the assets.rake inclusion, as it cannot read the configuration when defining tasks. * Add require for Addressable
ecb3325
to
6286cdd
Compare
This change is